GBML manual / Backgrounds

zoom_background_visible

Shows or hides the room’s zoomable background. It is showing when the room starts.

Works differently on Game Boy - The Game Boy hides a zoomable background by making the picture's colors black, and shows it by putting them back.

Works differently on Game Boy Color - The Game Boy Color hides a zoomable background by making the picture's colors black, and shows it by putting them back.

Sega Genesis: not available

On other consoles this differs: see Side by side and How the consoles differ.

Syntax

zoom_background_visible(visible)

Arguments

NameType
visiblebool

Returns

Nothing.

Description

Shows or hides the room's zoomable background. It is showing when the room starts. It does nothing in a room that has no zoomable background.

Hiding it always works. Showing it can be refused: while it is on screen the console only has two ordinary background layers, so if more than two are showing at that moment, it stays hidden instead. That can happen if backgrounds you made with background_create were left showing from the room before. A room that begins like that starts with its zoomable background hidden. Hide or destroy one of the others and call this again.

Hiding the picture does not give the room its other two layers back. A room that has a zoomable background has only two ordinary layers, whether the picture is showing or not. The limit belongs to the room. That is on purpose: it means showing the picture later can never run you out of layers by surprise.

Example

// Create event of the object that runs the map screen. The picture starts hidden.
zoom_background_visible(false);

This is the first line of a map that opens when the player presses a button: the zoomable background exists from the moment the room loads, but nothing shows until the object shows it.

On the GBA

A no-op in a room that has no zoomable background. Hiding it always works. SHOWING it can be refused: with it on screen the console has only two regular layers, so if more than two are showing at that moment (backgrounds you made with background_create and left up from the room before, say) it stays hidden instead. A room that starts like that begins with it hidden. Hiding it when the room does not need it costs the picture nothing to draw, but the room still keeps its limit of two regular layers: the limit belongs to the room, not to whether the picture is showing.

See also: Zoomable backgroundszoom_background_prioritydraw_backgroundbackground_create